#ifndef HATER_H
#define HATER_H

#include <algorithm>
#include <string>
#include <iostream>
#include <list>
#include <set>
#include <fstream>
#include <sstream>
#include <locale>
#include <deque>
#include <queue>

using namespace std;

namespace Zen
{
namespace utility
{
	typedef list<string>            StringList;
	typedef set<string>             StringSet;
	typedef vector<string>          StringVector;

	template <class T> void SafeDelete     (T*& p) { if (p) { delete    p; p = NULL; } }
	template <class T> void SafeDeleteArray(T*& p) { if (p) { delete [] p; p = NULL; } }


	 //aho_corasick.h
	namespace aho_corasick {}

	 //workflow.h
	class Workflow;

	// String
	StringList StringSplit(const string& strText, char cDelim);
	string StringJoin(const StringList& sg, char cDelim);
	string StringFormat(int nSize, const char* szFormat, ...);
	wstring StringFormat(int nSize, const wchar_t* szFormat, ...);
	string WrapText(const string& strText, char cWrapper);

	// System info
	string GetLocalIP();
	string GetCurDate();
	string GetCurTime();
	string GetCurDateTime();
	string GetMD5(istream& is);


	// Conversion
	enum IConvType { kUTF8, kUTF16, kLocal, };
	string IConv(const string& strText, IConvType from, IConvType to);
	wstring a2w(const string& a);
	string w2a(const wstring& w);
	int a2i(const string& a);
	string i2a(int i);


}//end utility
}//end Zen

#endif